<?php

namespace app\admin\model\choi;

use think\Model;


class Setting extends Model
{
    public static function getAllKeys()
    {
        return self::column('key');
    }

    public static function getValue($key)
    {
        return self::where('key', $key)->value('value');
    }

    public static function updateValue($key, $value)
    {
        return self::where('key', $key)->update(['value' => $value]);
    }

    public static function add($key, $value, $describe = '')
    {
        return self::insert([
            'key' => $key,
            'value' => $value,
            'describe' => $describe
        ]);
    }





}
